]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
lookingGlass: Take separate grab for object inspector
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Feb 2022 17:10:46 +0000 (18:10 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Feb 2022 17:15:28 +0000 (18:15 +0100)
The object inspector is not a child of the main looking glass dialog,
so it no longer receives pointer/touch events with the new grab API.

Fix this by pushing/popping a separate grab.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5150

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2218>

js/ui/lookingGlass.js

index 96f4d9cd7715a58826da0d5efb4dac101a4701a3..30d668f3c8efaaf9d7b1ffb7308e9794db59a567 100644 (file)
@@ -451,6 +451,14 @@ class ObjInspector extends St.ScrollView {
     open(sourceActor) {
         if (this._open)
             return;
+
+        const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS });
+        if (grab.get_seat_state() === Clutter.GrabState.NONE) {
+            Main.popModal(grab);
+            return;
+        }
+
+        this._grab = grab;
         this._previousObj = null;
         this._open = true;
         this.show();
@@ -470,6 +478,8 @@ class ObjInspector extends St.ScrollView {
     close() {
         if (!this._open)
             return;
+        Main.popModal(this._grab);
+        this._grab = null;
         this._open = false;
         this.hide();
         this._previousObj = null;